feat: invert call stack in flame graph to render as icicle graph#6090
feat: invert call stack in flame graph to render as icicle graph#6090cathaysia wants to merge 3 commits into
Conversation
4f7ab4e to
2e38000
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6090 +/- ##
==========================================
- Coverage 83.69% 83.33% -0.36%
==========================================
Files 338 339 +1
Lines 35693 36098 +405
Branches 9904 10096 +192
==========================================
+ Hits 29873 30084 +211
- Misses 5392 5586 +194
Partials 428 428 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hello, is anyone reviewing this PR? I don't have the permission to request a review. |
|
Unfortunately this implementation is too slow on large profiles. For example, clicking the "Invert call stack" checkbox on this flame graph causes the page to hang permanently: Furthermore, I think this view is only useful if most of the time is spent in a single leaf function. Once you have time spread over many different leaves, the inverted flame graph becomes less useful because all the root nodes will be very small boxes, and then their children are even smaller boxes. However, what can be useful is the inverted flame graph for a single leaf function. In #5233 I'm prototyping a panel where you can select a function on the left side, and then see flame graphs for that function on the right side. When limited to a single function, computing the inverted flame graph can be done in reasonable time because the number of nodes in the tree is much more limited. Here's an example: |
|
Thanks for the large-profile test case. I reproduced the hang locally with the profile from the preview link: computing the inverted flame graph timing for thread I pushed
With the same large profile / thread I also added a regression test for the same-name-node case so the inverted tree does not combine unrelated call paths such as |
|
Actually, I think it would be more appropriate to move the data processing part to WASM. Rust can precisely control memory, and Rust itself provides many tools for benchmarking. |
add a invert callstack checkbox.
before:
after:

fix #6077